The files contained in the StuffIt file are the first two training programs
from the book "How To Write Macintosh Software" written by Scott Knaster formerly of Apple. Both a LightSpeed Pascal and LightSpeed C version of the
programs is provided. The programs are adapted from the First Edition of the book, which is now out in a Second Edition. There are few differences between the two editions and these programs should allowing you to do the debugging exercises in chapter 7 of either edition. If you wish you can compare line-for-line and make any changes necessary. These programs can also be modified to complete the other exercises in the book, the basc structure follows the ShowOff program. You will need to follow line-for-line to compare the programs and make appropriate changes.
For those of you just starting to program on the Macintosh, I highly recommend
this book. Scott has done an excellent job of making the Macintosh programming
environment understandable.
Believe me when I say that programming an easy to use program for the Mac is much more complex than using the finished product.
The program 'ShowOff' is introduced in chapter 7 of the book, 'Real Live Debugging'. For those programming in LightSpeed Pascal 'debugging' is sort of an understatement, it can take hours just to get to the point of starting to debug along with the book.
The Pascal program 'ShowOff' is written in MPW Pascal, which differs from LightSpeed in several ways, the most obvious being that MPW accepts incompatible 'typing' on a single line of MPW Pascal code.
While this is nice for MPW Macintosh programmers, as the Mac environment forces mixing of types with regular frequency, it can be quite frustrating when MPW source is used with a 'classical' Pascal compiler, in as far as 'typing' is concerned. LightSpeed is such a complier.
The first Pascal program is 'ShowOff 7-1'. This is the first exercise in debugging a Mac program. This version is converted to LightSpeed, with all 'bugs' intact so you may happily go 'bug hunting'. Except as noted in the source code this version is the same as in the book, just converted to LightSpeed.
The second Pascal program is 'ShowOff 7-2' this is the debugged version and matches, with the conditions stated above, the book program 'Listing 7-2'
Finally, the 'C' program 'ShowOff 7-4' is a 'C' conversion of listing 7-2 written for MPW C. There were several alterations needed (for MPW differences as well as fixing errors in the First Edition book) to convert to LightSpeed C.
As an added adventure the 'C' program 'Show 7-4 W/Bugs' adds the bugs back into the program just like listing 7-1 in Pascal. Both of these programs can be used while doing chapter 7's exercises using LightSpeed C.
For those of you who are just learning to program either the Macintosh, LightSpeed Pascal or C, I offer these conversions of SHOWOFF, FREE and in the
PUBLIC DOMAIN to ease your learning curve. Pass the entire StuffIt file to as
many BBSs as you wish. This is a small token of gratitude for all the
freeware I've received for the Macintosh.
Thanks goes to Larry Rosenstein of Apple for his help in setting me straight
on a couple of subjects during my learning curve on the Mac.
=========================== MINI ADVERTISEMENT ========================
Also look for other source code offerings through the ShareWare program.
All source code includes extensive comments (Even I need them to remind
me what I did a week earlier), resource files if used and complete ready to
run projects to open from LightSpeed products. So far all programs are
suitable for use as application shells. Presently two programs are available:
'Text Convert'- in LightSpeed Pascal and LightSpeed C - A simple application
to convert text file line endings to be Mac or IBM compatible. A nice shell program with many Mac features ready to modify for your use. This one is nice
for those of you learning LightSpeed 'C' who want some examples of a Pascal
and 'C' program which do the same things. The 'C' version was converted as
closely as possible directly from the Pascal version.. Having both helps to
understand the conversion of the "Inside Macintosh" calls, which are written
in Pascal.
'IFSv1.xx'- in LightSpeed C - A graphics program for decompressing a graphic
picture stored in 'Iterated Function System' format. Supports original style
8 color operations (so it runs on Mac Plus, SE and II). Included are a
normal Mac verison and a 68881 version to take advantage of the Mac II's
floating point coprocessor to speed up the calculations.
** If you are mainly looking for a nice Shell program, this is my latest and
** greatest, includes radio and check boxes, static text and edit items
** inside a dialog to allow modification of program specific variables or
** run time options.
Both programs, while being useful and fun applications, are really ment to be
application shells, complete with many Macintosh user interface features of
interest to many programs. Features include: menus control, multiple
window operations, WindowPicture saving for automatic window information
upating, growing, zooming, text file loading and saving, DA operation etc.
Look for the compiled applications on GEnie, CompuServe and the MacInfo BBS
(415) 795-8862. Either program's source code may also be ordered for a ShareWare registration fee as specified below. By honoring the ShareWare request for the source code, you will encourge further source code releases. The fee is modest and helps offset the programming time and connect charges incurred in providing these programs to the Macintosh community.
If you would like to register your ShareWare support and obtain the source
code of the latest version of either program, please send $5 per program
(or $7.50 and 2 800K disks for both), a ** 800K ** disk PER PROGRAM and a
STAMPED self-addressed envelope (strong enough to mail your disk in) along
with your registration.
PLEASE NOTE: I WILL NOT SEND NEWEST VERSION WITHOUT YOUR DISKS
AND SELF-ADDRESSED-STAMPED ENVELOPE!
Please specify which program you want, 'Text Convert' will be in
both LightSpeed Pascal and C while 'IFSv1.xx' is only available in 'C' only.
Remember: If you send $7.50 and 2 800K disks you'll get both programs!!
Stephen Scandalis
1414 Prince Edward Way
Sunnyvale, CA 94087
P.S. For those who do not already have it, the source code for the program
'ShowOff' in LightSpeed Pascal and C is available as FREEWARE, in the
Public Domain. 'ShowOff' is a debugging training exercise from the
book "How To Write Macintosh Software" by Scott Knaster. You can
find the complete source code on Genie, CompuServe and on the MacInfo BBS
(415) 795-8862 or ask for it when you request my other programs.